package com.sh.healthtv.net.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author 作者 675:
 * @version 创建时间：2016-7-19 上午11:29:10 播放地址列表和是否收藏 对应接口 ———— 2.6获取节目视频播放地址
 */
public class MediaPlayList extends BaseBean implements Parcelable {

    private static final long serialVersionUID = 1L;
    /**
     * 节目是否已收藏
     */
    private boolean favorite;
    /**
     * 视频列表
     */
    private List<Definition> list;

    public boolean isFavorite() {
        return favorite;
    }

    public void setFavorite(boolean favorite) {
        this.favorite = favorite;
    }

    public List<Definition> getList() {
        return list;
    }

    public void setList(List<Definition> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "MediaPlayList [favorite=" + favorite + ", list=" + list + "]";
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByte(this.favorite ? (byte) 1 : (byte) 0);
        dest.writeTypedList(this.list);
    }

    public MediaPlayList() {
    }

    protected MediaPlayList(Parcel in) {
        this.favorite = in.readByte() != 0;
        this.list = in.createTypedArrayList(Definition.CREATOR);
    }

    public static final Creator<MediaPlayList> CREATOR = new Creator<MediaPlayList>() {
        @Override
        public MediaPlayList createFromParcel(Parcel source) {
            return new MediaPlayList(source);
        }

        @Override
        public MediaPlayList[] newArray(int size) {
            return new MediaPlayList[size];
        }
    };
}
